package cn.itcast.crm.service;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import cn.itcast.crm.domain.Customer;

public interface CustomerService {

	// 查询 未连接客户信息

	@Path("/usernofindnoassection")
	@GET
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findNoAssociationCustomers();

	// 查询已连接客户信息
	@Path("/userfixedassection/{fixedAreaId}")
	@GET
	@Produces({ "application/xml", "application/json" })

	public List<Customer> findHasAssociationFixedAreaCustomers(@PathParam("fixedAreaId") String fixedAreaId);

	// 添加快递员和定区的关联
	@Path("/assectiongetfixed")
	@PUT
	public void assectiongetficxed(@QueryParam("customers") String customers,
			@QueryParam("fixedAreaId") String fixedAreaId);

	// 添加注册客户信息 save
	@Path("/customer")
	@POST
	@Consumes({ "application/xml", "application/json" })
	public void request(Customer customer);

	// 为客户关联到定区上 将所有 id 拼接成字符串 1,2,3,
	@Path("/assigncustomerstodecidedzone")
	@PUT
	public void assigncustomerstodecidedzoned(@QueryParam("customerIdStr") String customerIdStr,
			@QueryParam("fixedAreaId") String fixedAreaId);

	// 取消已关联的客户和定区的连接
	/*
	 * @Path("/assignNocustomerstodecidedzone")
	 * 
	 * @PUT public void
	 * assignNocustomerstodecidedzone(@QueryParam("fixedAreaId") String
	 * fixedAreaId);
	 */
	// 邮箱激活
	@Path("/customer/telephone/{telephone}")
	@GET
	@Consumes({ "application/xml", "application/json" })
	public Customer findByTelephone(@PathParam("telephone") String telephone);

	@Path("/customer/updatetype/{telephone}")
	@GET
	public void updateTpe(@PathParam("telephone") String telephone);

	// 进行客户登录校验
	@Path("/customer/login")
	@GET
	@Consumes({ "application/xml", "application/json" })
	public Customer queryLogin(@QueryParam("telephone") String telephone, @QueryParam("password") String password);

	// 将寄件人下单地址 以WEBService方式 发送CRM 地址 库获取 对应客户关联 定区
	// 根据下单地址获取 定区编码方法
	/*
	 * @Path("/customer/findFixedAreaIdByAddress")
	 * 
	 * @GET public String findFixedAreaIdByAddress(@QueryParam("address") String
	 * address);
	 */
	@Path("/customer/findFixedAreaIdByAddress")
	@GET
	@Consumes({ "application/xml", "application/json" })
	public String findFixedAreaIdByAddress(@QueryParam("address") String address);
}